package com.letv.app.ljodfh.utils;

import android.content.Context;
import android.net.wifi.WifiManager;
import android.telephony.TelephonyManager;
import android.text.TextUtils;

public class ToolUtils {

    /**
     * 获取设备的唯一deviceID
     * @param context
     * @return
     */
    public static final String getDeviceID(Context context) {
        String deviceId = "";
        TelephonyManager TelephonyMgr = (TelephonyManager) context.getSystemService(context.TELEPHONY_SERVICE);
        deviceId = TelephonyMgr.getDeviceId();
        if (TextUtils.isEmpty(deviceId)) {
            WifiManager wm = (WifiManager) context.getSystemService(context.WIFI_SERVICE);
            deviceId = wm.getConnectionInfo().getMacAddress();
        }
        return deviceId;

    }
}
